home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / bbs / maxkit25.zip / MAXBDL25.ARJ / MAXBDL25.MEX next >
Text File  |  1996-11-04  |  3KB  |  94 lines

  1.  
  2. // ==========================================================================
  3. // Copyright 1995 1997 by Gerry Ellison.  All rights reserved.
  4. // File: MAXBDL25.MEX
  5. // Desc: Displays a list of users birthdays to con, file or both.
  6. // --------------------------------------------------------------------------
  7. #include <max.mh>
  8. #include <intpad.mh>
  9.  
  10. int main(string: argv) {                         // begin  birthday list
  11.   int: ok, cy, chh, cnt;
  12.   char: fd, nonstop;
  13.   string: cm, cd, bbs, LCB, LMB, YM, YB, line, line2, bdlpath;
  14.  
  15.   struct _usr: u;
  16.  
  17.   struct _stamp: now;
  18.  
  19. //            CHANGE THIS FOR YOUR BBS.
  20. // --------------------------------------------------------------------------
  21.   bdlpath := "C:\\Max\\Maxkit\\Birthlst.bbs"; // path and name of birthday list
  22.   bbs := " The Mountain Top BBS! ";  // put your bbs name HERE!
  23. // ATT.  │                       │NO longer then this!
  24. // --------------------------------------------------------------------------
  25.     remove(bdlpath);                            // deletes Birthlst.bbs
  26.  
  27.     timestamp(now);
  28.      cm:=intpadleft(now.date.month,2,'0');
  29.      cd:=intpadleft(now.date.day,2,'0');
  30.      cy:=(now.date.year)+1980;
  31.  
  32.     reset_more(nonstop);
  33.  {
  34.     LCB:="\x16\x01\x10\x9B";
  35.     LMB:="\x16\x01\x10\x9D";
  36.     YM:="\x16\x01\x5E";
  37.     YB:="\x16\x01\x1e";
  38.  
  39.     print("\fMAXBDL25\n");
  40.  
  41. line := "\f\n\n   "+LCB+"┌"+strpad("─",31,'─')+"┬"+strpad("─",40,'─')+"┐"
  42. COL_GRAY"\n   "+LCB+"│"+YM+"░▒▓█"+bbs+"█▓▒░"+LCB+"│"+strpad(" ",15,' ')+YB+cm+"-"+cd+"-"+itostr(cy)+LCB+strpad(" ",15,' ')+"│"
  43. COL_GRAY"\n   "+LCB+"├"+strpad("─",31,'─')+"┴"+strpad("─",40,'─')+"┤"
  44. COL_GRAY"\n   "+LCB+"│"+strpad(" ",27,' ')+YB+"Congratulations to"+LCB+strpad(" ",27,' ')+"│"
  45. COL_GRAY"\n   "+LCB+"│         "+bbs+" users who have birthdays today:        │"
  46. COL_GRAY"\n   "+LCB+"├"+strpad("─",72,'─')+"┤"
  47. COL_GRAY"\n   "+LCB+"│"+strpad(" ",72,' ')+"│"COL_GRAY;
  48.  
  49.     if (argv = "")
  50.         print("\n"+line+"\n");
  51.       else
  52.         print("Compiling C:\Max\Misc\Maxbdl25.bbs.\n");
  53.   {
  54.     for (ok := userfindopen("","",u);
  55.          ok AND do_more(nonstop, COL_CYAN);
  56.          ok := userfindnext(u))
  57.  
  58.     if(substr(u.dob,6,2)+substr(u.dob,9,2) = cm+cd)
  59.     {
  60.     cnt := cnt+1;
  61.  
  62.     if (cnt = 1) {
  63.         fd := open(bdlpath, IOPEN_CREATE | IOPEN_WRITE);
  64.               writeln(fd, "");
  65.         writeln(fd,line);
  66.         }
  67.  
  68.   line2 := "   "+LCB+"│        "+strpad(u.name,28,' ')+strpad(u.city,36,' ')+
  69.            "│"COL_GRAY"\n";
  70.     if (argv = "")
  71.         print(line2);
  72.  
  73.   line2 := "   "+LCB+"│        "+strpad(u.name,28,' ')+strpad(u.city,36,' ')+
  74.            "│"COL_GRAY;
  75.    writeln(fd, line2);
  76.     }
  77.   }
  78. line := "   "+LCB+"│"+strpad(" ",72,' ')+"│"COL_GRAY"\n   "+
  79.         LCB+"╚"+strpad("═",72,'═')+"╝"COL_GRAY"\n";
  80.  
  81.     if (argv = "")
  82.         print(line+"\n");
  83.  
  84.       if (cnt >= 1) {
  85.           writeln(fd,line);
  86. line := "   â";
  87.           writeln(fd,line);
  88.           close(fd);
  89.          }
  90.       if (argv = "")
  91.           menu_cmd(106,"");                      //press enter
  92.  }
  93. }                                                // end  birthday list
  94.